package de.sisoft.gcjack.model;

import java.util.Locale;

public class GeoCache implements AsyncResult {

    private User owner;
    private String name;
    private String gcCode;
    private String type;
    private String hidden;
    private float difficulty;
    private float terrain;
    
    private float avgDifficulty;
    private float avgTerrain;
    private float avgCreativity;
    private float avgWowFactor;
    private float avgCoordQuality;
    private int avgRecommendation;
    private int numberVotes = 0;

    private float votedDifficulty = 1.0f;
    private float votedTerrain = 1.0f;
    private float votedCreativity = 1.0f;
    private float votedWOW = 1.0f;
    private float votedCoordQuality = 1.0f;
    private int votedRecommendation = 0;

    public GeoCache() {
	this.name = "";
	this.gcCode = "";
	this.owner = new User();
	this.type = "";
	this.difficulty = 0.0f;
	this.terrain = 0.0f;
	this.hidden = "";
    }

    public GeoCache(String gcCode) {
	this.setGcCode(gcCode);
    }

    /**
     * @return the gcCode
     */
    public String getGcCode() {
	return gcCode;
    }

    /**
     * @param gcCode
     *            the gcCode to set
     */
    public void setGcCode(String gcCode) {
	// TODO: make this better - worse case
	if (gcCode != null && gcCode.length() < 7
		&& !gcCode.toUpperCase().startsWith("GC")) {
	    this.gcCode = "GC" + gcCode.toUpperCase(new Locale("DE-de"));
	}
    }

    public String getName() {
	return name;
    }

    public void setName(String name) {
	this.name = name;
    }

    public User getOwner() {
	return owner;
    }

    public void setOwner(User owner) {
	this.owner = owner;
    }

    public String getType() {
	return type;
    }

    public void setType(String type) {
	this.type = type;
    }

    public float getDifficulty() {
	return difficulty;
    }

    public void setDifficulty(float difficulty) {
	this.difficulty = difficulty;
    }

    public float getTerrain() {
	return terrain;
    }

    public void setTerrain(float terrain) {
	this.terrain = terrain;
    }

    public String getHidden() {
	return hidden;
    }

    public void setHidden(String hidden) {
	this.hidden = hidden;
    }

    public float getAvgDifficulty() {
        return avgDifficulty;
    }

    public void setAvgDifficulty(float avgDifficulty) {
        this.avgDifficulty = avgDifficulty;
    }

    public float getAvgTerrain() {
        return avgTerrain;
    }

    public void setAvgTerrain(float avgTerrain) {
        this.avgTerrain = avgTerrain;
    }

    public float getAvgCreativity() {
        return avgCreativity;
    }

    public void setAvgCreativity(float avgCreativity) {
        this.avgCreativity = avgCreativity;
    }

    public float getAvgWowFactor() {
        return avgWowFactor;
    }

    public void setAvgWowFactor(float avgWowFactor) {
        this.avgWowFactor = avgWowFactor;
    }

    public float getAvgCoordQuality() {
        return avgCoordQuality;
    }

    public void setAvgCoordQuality(float avgCoordQuality) {
        this.avgCoordQuality = avgCoordQuality;
    }

    public int getAvgRecommendation() {
        return avgRecommendation;
    }

    public void setAvgRecommendation(int avgRecommendation) {
        this.avgRecommendation = avgRecommendation;
    }

    /**
     * @return the numberVotes
     */
    public int getNumberVotes() {
	return numberVotes;
    }

    /**
     * @param numberVotes the numberVotes to set
     */
    public void setNumberVotes(int numberVotes) {
	this.numberVotes = numberVotes;
    }

    public float getVotedDifficulty() {
        return votedDifficulty;
    }

    public void setVotedDifficulty(float votedDifficulty) {
        this.votedDifficulty = votedDifficulty;
    }

    public float getVotedTerrain() {
        return votedTerrain;
    }

    public void setVotedTerrain(float votedTerrain) {
        this.votedTerrain = votedTerrain;
    }

    public float getVotedCreativity() {
        return votedCreativity;
    }

    public void setVotedCreativity(float votedCreativity) {
        this.votedCreativity = votedCreativity;
    }

    public float getVotedWOW() {
        return votedWOW;
    }

    public void setVotedWOW(float votedWOW) {
        this.votedWOW = votedWOW;
    }

    public float getVotedCoordQuality() {
        return votedCoordQuality;
    }

    public void setVotedCoordQuality(float votedCoordQuality) {
        this.votedCoordQuality = votedCoordQuality;
    }

    public int getVotedRecommendation() {
        return votedRecommendation;
    }

    public void setVotedRecommendation(int votedRecommendation) {
        this.votedRecommendation = votedRecommendation;
    }

}
